
var crypto = require('crypto')

/**
 *  Gets a string representation of the current date and time.
 * @returns {String} string representation of current date and time in format 
 *                  - mm/dd/yyy - HH:mm
 */
exports.getDateTime = function() {
    var currentTime = new Date();
    var month = currentTime.getMonth() + 1;
    var day = currentTime.getDate();
    var year = currentTime.getFullYear();

    var hours = currentTime.getHours();
    var minutes = currentTime.getMinutes();
    if (minutes < 10) {
        minutes = "0" + minutes;
    }

    return month + "/" + day + "/" + year + " " + hours + ":" + minutes;
};

exports.getMD5 = function(data) {
    return crypto.createHash('md5').update(data).digest("hex");
};